package com.gupaoedu.springboot.springbootfrist.fristDemo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * <p>
 *
 * </p>
 *
 * @author Nicky
 * @since 2019-07-11
 */
@ComponentScan(basePackages = "com.gupaoedu.springboot.springbootfrist")
public class ConfigurationMain {

    public static void main(String[] args) {
//        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ConfigurationDemo.class);
//        DemoClass demoClass = applicationContext.getBean(DemoClass.class); //DL
//
//        System.out.println(demoClass.say())


        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ConfigurationMain.class);
        String[] beanDefNames = applicationContext.getBeanDefinitionNames();
        for (int i = 0; i < beanDefNames.length; i++) {
            System.out.println(beanDefNames[i]);
        }

    }
}
